package ae.pcfc.cldos.online.common.clddb.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.IndexColumn;
import org.hibernate.envers.AuditTable;
import org.hibernate.envers.Audited;
import org.hibernate.envers.ModificationStore;
import org.hibernate.envers.RelationTargetAuditMode;

import ae.pcfc.cldos.online.common.domain.BaseEntity;


/**
 * The persistent class for the T_CLDOS_APP_META_DATA database table.
 * 
 */
@Entity
@Table(name="T_CLDOS_APP_META_DATA")
@Audited(modStore=ModificationStore.FULL, targetAuditMode=RelationTargetAuditMode.NOT_AUDITED)
@AuditTable(value="T_CLDOS_APP_META_DATA_AUD")
@SequenceGenerator(name = "SQ_CLDOS_APP_ID", sequenceName = "SQ_CLDOS_APP_ID", initialValue = 1, allocationSize = 1)
public class AppMetaData extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static final String __EMPLOYEE_DETAILS = "EmployeeDetail";
	public static final String __TEMP_FILE_STORAGES = "tempFileStorages";
	public static final String __APPLICATION_DATE = "applicationDate";
	
	public static final String __CLIENT_REF_NO = "clientRefNo";
	
	public static final String __CLIENT_ID = "clientId";
	public static final String __USER_ID = "userId";
	
	public static final String __ID = "applicationId";
	
	public static final String __PROCESS_CODE = "processCode";
	public static final String __SERVICE_CODE = "serviceCode";
	public static final String __SERVICE_MASTER = "ServiceMaster";
	public static final String __APPLICATION_STATUS = "ApplicationStatus";
	public static final String __APPLICATION_STATUS_CODE = "statusCode";
	
	public static final String __EMPLOYMENT_VISA_CANCEL = "employmentVisaCancel";
	public static final String __EMPLOYMENT_VISA_RENEWAL = "employmentVisaRenew";
	
	public static final String __NOC_LETTERS = "NocLetter";
	
	
	public static final String __VISIT_VISA_CANCEL = "visitVisaCancel";
	public static final String __VISIT_VISA = "visitVisa";
	
	
	public static final String __WF_STATUS_INITIATED = "INITIATED";
	public static final String __WF_STATUS_RESUBMITED = "RESUBMITED";
	
	public static final String __REVIEW_COMMENTS = "reviewComments";
	
	
	public static final String _PROCESS = "Process";
	public static final String __APP_COMMENTS = "appComments";
	
	public static final String WF_STATUS_D_AND_D = "CLD VERIFICATION";
	public static final String WF_STATUS_EP_PAYMENT = "EP PAYMENT COMPLETED";
	
	public static final String INCIDENT_ID = "wfIncidentId";
	
	@Id
	@GeneratedValue( strategy = GenerationType.SEQUENCE, generator="SQ_CLDOS_APP_ID")
	@Column(name="APPLICATION_ID")
	private Long applicationId;

	@Column(name="APP_COMMENTS")
	private String appComments;

	@Temporal(TemporalType.DATE)
	@Column(name="APPLICATION_DATE")
	private Date applicationDate;

	@Column(name="CLIENT_ID")
	private Long clientId;

	@Column(name="CLIENT_REF_NO")
	private String clientRefNo;

	@Column(name="USER_ID")
	private Long userId;

	@Column(name="WF_INCIDENT_ID")
	private String wfIncidentId;

	@Column(name="WF_INITIATED_BY")
	private String wfInitiatedBy;

	@Column(name="WF_STATUS")
	private String wfStatus;
	
	@Column(name="STATUS_CODE")
	private Long statusCode;
	
	@Column(name="PROCESS_CODE")
	private String processCode;
	
	@Column(name="SERVICE_CODE")
	private Long serviceCode;
	
	@Column(name="DEBIT_NOTE_ID")
	private Integer debitNoteId;
	
	@Column(name="FINAL_PAY_REF_NO")
	private Integer finalPayRefNo;
	
	@Column(name="PAYMENT_ADVICE_NO")
	private String paymentAdviceNo;
	
	@Column(name="BG_PAYMENT_ADVICE_NO")
	private String bgPaymentAdviceNo;
	
	

	public String getBgPaymentAdviceNo() {
		return bgPaymentAdviceNo;
	}

	public void setBgPaymentAdviceNo(String bgPaymentAdviceNo) {
		this.bgPaymentAdviceNo = bgPaymentAdviceNo;
	}

	//bi-directional many-to-one association to ApplicationAttachment
	@OneToMany(mappedBy="AppMetaData", fetch=FetchType.LAZY)
	private List<ApplicationAttachment> ApplicationAttachments;
	

	//bi-directional many-to-one association to ApplicationStatus
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="STATUS_CODE", insertable=false, updatable=false)
	private ApplicationStatus ApplicationStatus;

	//bi-directional many-to-one association to Process
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="PROCESS_CODE", insertable=false, updatable=false)
	private Process Process;

	//bi-directional many-to-one association to ServiceMaster
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="SERVICE_CODE", insertable=false, updatable=false)
	private ServiceMaster ServiceMaster;

	//bi-directional many-to-one association to EmployeeDetail
	@OneToOne(mappedBy="AppMetaData", fetch=FetchType.LAZY, optional=false, cascade=CascadeType.ALL)
	private EmploymentVisaCancel employmentVisaCancel;
	
	//bi-directional many-to-one association to EmployeeDetail
	@OneToOne(mappedBy="AppMetaData", fetch=FetchType.LAZY, optional=false, cascade=CascadeType.ALL)
	private EmploymentVisaRenew employmentVisaRenew;
	
	public EmploymentVisaCancel getEmploymentVisaCancel() {
		return employmentVisaCancel;
	}

	public void setEmploymentVisaCancel(EmploymentVisaCancel employmentVisaCancel) {
		this.employmentVisaCancel = employmentVisaCancel;
	}

	public EmploymentVisaRenew getEmploymentVisaRenew() {
		return employmentVisaRenew;
	}

	public void setEmploymentVisaRenew(EmploymentVisaRenew employmentVisaRenew) {
		this.employmentVisaRenew = employmentVisaRenew;
	}
	
	//bi-directional many-to-one association to EmployeeDetail
	@OneToOne(mappedBy="AppMetaData", fetch=FetchType.LAZY, optional=false, cascade=CascadeType.ALL)
	private NocLetter NocLetter;
	
	//bi-directional many-to-one association to EmployeeDetail
	@OneToOne(mappedBy="AppMetaData", fetch=FetchType.LAZY, optional=false, cascade=CascadeType.ALL)
	private VisitVisa visitVisa;
	
	public NocLetter getNocLetter() {
		return NocLetter;
	}

	public void setNocLetter(NocLetter nocLetter) {
		NocLetter = nocLetter;
	}

	public VisitVisa getVisitVisa() {
		return this.visitVisa;
	}

	public void setVisitVisa(VisitVisa visitVisa) {
		this.visitVisa = visitVisa;
	}

	public VisitVisaCancel getVisitVisaCancel() {
		return visitVisaCancel;
	}

	public void setVisitVisaCancel(VisitVisaCancel visitVisaCancel) {
		this.visitVisaCancel = visitVisaCancel;
	}

	//bi-directional many-to-one association to EmployeeDetail
	@OneToOne(mappedBy="AppMetaData", fetch=FetchType.LAZY, optional=false, cascade=CascadeType.ALL)
	private VisitVisaCancel visitVisaCancel;

	//bi-directional many-to-one association to EmployeeDetail
	@OneToOne(mappedBy="AppMetaData", fetch=FetchType.LAZY, optional=false, cascade=CascadeType.ALL)
	private EmployeeDetail EmployeeDetail;

	//bi-directional many-to-one association to FinanceTransaction
	@OneToMany(mappedBy="AppMetaData")
	private List<FinanceTransaction> FinanceTransactions;

	//bi-directional many-to-one association to MessageInbox
	@OneToMany(mappedBy="AppMetaData")
	private List<MessageInbox> MessageInboxs;

	//bi-directional many-to-one association to ProcessStepAction
	@OneToMany(mappedBy="AppMetaData")
	private List<ProcessStepAction> ProcessStepActions;
	
	
	@OneToMany(mappedBy="appMetaData", fetch=FetchType.LAZY)
	private List<TempFileStorage> tempFileStorages;
	
	@IndexColumn(name="RC_ID")
	@OneToMany(mappedBy="appMetaData", fetch=FetchType.LAZY)
	private List<ReviewComments> reviewComments;

    public AppMetaData() {
    }

	public Long getApplicationId() {
		return this.applicationId;
	}

	public void setApplicationId(Long applicationId) {
		this.applicationId = applicationId;
	}

	public String getAppComments() {
		return this.appComments;
	}

	public void setAppComments(String appComments) {
		this.appComments = appComments;
	}

	public Date getApplicationDate() {
		return this.applicationDate;
	}

	public void setApplicationDate(Date applicationDate) {
		this.applicationDate = applicationDate;
	}

	public Long getClientId() {
		return this.clientId;
	}

	public void setClientId(Long clientId) {
		this.clientId = clientId;
	}

	public String getClientRefNo() {
		return this.clientRefNo;
	}

	public void setClientRefNo(String clientRefNo) {
		this.clientRefNo = clientRefNo;
	}

	public Long getUserId() {
		return this.userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getWfIncidentId() {
		return this.wfIncidentId;
	}

	public void setWfIncidentId(String wfIncidentId) {
		this.wfIncidentId = wfIncidentId;
	}

	public String getWfInitiatedBy() {
		return this.wfInitiatedBy;
	}

	public void setWfInitiatedBy(String wfInitiatedBy) {
		this.wfInitiatedBy = wfInitiatedBy;
	}

	public String getWfStatus() {
		return this.wfStatus;
	}

	public void setWfStatus(String wfStatus) {
		this.wfStatus = wfStatus;
	}

	public List<ApplicationAttachment> getApplicationAttachments() {
		return this.ApplicationAttachments;
	}

	public void setApplicationAttachments(List<ApplicationAttachment> ApplicationAttachments) {
		this.ApplicationAttachments = ApplicationAttachments;
	}
	
	public ApplicationStatus getApplicationStatus() {
		return this.ApplicationStatus;
	}

	public void setApplicationStatus(ApplicationStatus ApplicationStatus) {
		this.ApplicationStatus = ApplicationStatus;
	}
	
	public Process getProcess() {
		return this.Process;
	}

	public void setProcess(Process Process) {
		this.Process = Process;
	}
	
	public ServiceMaster getServiceMaster() {
		return this.ServiceMaster;
	}

	public void setServiceMaster(ServiceMaster ServiceMaster) {
		this.ServiceMaster = ServiceMaster;
	}
	
	public EmployeeDetail getEmployeeDetail() {
		return this.EmployeeDetail;
	}

	public void setEmployeeDetail(EmployeeDetail EmployeeDetail) {
		this.EmployeeDetail = EmployeeDetail;
	}
	
	public List<FinanceTransaction> getFinanceTransactions() {
		return this.FinanceTransactions;
	}

	public void setFinanceTransactions(List<FinanceTransaction> FinanceTransactions) {
		this.FinanceTransactions = FinanceTransactions;
	}
	
	public List<MessageInbox> getMessageInboxs() {
		return this.MessageInboxs;
	}

	public void setMessageInboxs(List<MessageInbox> MessageInboxs) {
		this.MessageInboxs = MessageInboxs;
	}
	
	public List<ProcessStepAction> getProcessStepActions() {
		return this.ProcessStepActions;
	}

	public void setProcessStepActions(List<ProcessStepAction> ProcessStepActions) {
		this.ProcessStepActions = ProcessStepActions;
	}

	public List<TempFileStorage> getTempFileStorages() {
		return tempFileStorages;
	}

	public void setTempFileStorages(List<TempFileStorage> tempFileStorages) {
		this.tempFileStorages = tempFileStorages;
	}
	
	
	public Long getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(Long statusCode) {
		this.statusCode = statusCode;
	}

	
	public String getProcessCode() {
		return processCode;
	}

	public void setProcessCode(String processCode) {
		this.processCode = processCode;
	}
	
	
	public Long getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(Long serviceCode) {
		this.serviceCode = serviceCode;
	}

	public Integer getDebitNoteId() {
		return debitNoteId;
	}

	public void setDebitNoteId(Integer debitNoteId) {
		this.debitNoteId = debitNoteId;
	}

	public Integer getFinalPayRefNo() {
		return finalPayRefNo;
	}

	public void setFinalPayRefNo(Integer finalPayRefNo) {
		this.finalPayRefNo = finalPayRefNo;
	}

	public String getPaymentAdviceNo() {
		return paymentAdviceNo;
	}

	public void setPaymentAdviceNo(String paymentAdviceNo) {
		this.paymentAdviceNo = paymentAdviceNo;
	}

	public List<ReviewComments> getReviewComments() {
		return reviewComments;
	}

	public void setReviewComments(List<ReviewComments> reviewComments) {
		this.reviewComments = reviewComments;
	}
	
	
/*	public List<TempFileStorage> getTempFileStorages() {
		return this.TempFileStorages;
	}

	public void setTempFileStorages(List<TempFileStorage> TempFileStorages) {
		this.TempFileStorages = TempFileStorages;
	}*/
	
	
}